from time import sleep
#导入启动包
from selenium import webdriver
#导入chrome服务(车)
from selenium.webdriver.chrome.service import Service
#导入一个定位元素工具 By (方向盘)
from selenium.webdriver.common.by import By

#车里装进去一个司机
service = Service(executable_path='../自动化下单流程/chromedriver.exe')
#司机发动Chrome这个车
driver = webdriver.Chrome(service=service)

#开启百度
driver.get('D:\素材.html')
#百度全屏
driver.maximize_window()
sleep(1)
driver.find_element(By.XPATH,'//input[@value="确认弹窗按钮"]').click()
sleep(4)
# driver.switch_to.alert.accept()
# sleep(2)
driver.switch_to.alert.dismiss()
sleep(2)
a = driver.find_element(By.TAG_NAME,'font').text
print(a)